
$(function(){
	 $(document).on("click" ,".search-top li",function(){
                  $(this).addClass("cur").siblings().removeClass("cur")
    })
	$('.dingwei').kuCity();


 $.ajax({
                type:"get",
                url:"../view/data/sousuo.json",
                async:false,
                success: function(data){
                  $("#myInput").wy_inselect(data.sousuo);
                },
                error: function(XMLHTTPRequest, textStatus, errorThrown){
                  console.log("XMLHttpRequest :"+ XMLHTTPRequest);
                  console.log("textStatus :"+textStatus);
                  console.log("errorThrown :"+errorThrown);
               }
   });
 $(document).on("click","#search-btn",function(){
  var href=$(".search-input").val()
   window.location.href="./list.html?"+href;
 })
 $(document).on("click",".search-top li",function(){
    $(this).addClass("cur").siblings().removeClass("cur")
    $(".search-input").attr('placeholder',$(this).attr("data-type"))
    console.log($(this).attr("data-type"))
 })
		// 百度地图API功能
	var map = new BMap.Map("allmap");
	var point = new BMap.Point(116.331398,39.897445);
	map.centerAndZoom(point,12);

	function myFun(result){
		var cityName = result.name;
		map.setCenter(cityName);
		 $(".dingwei").val(cityName)
	}
	var myCity = new BMap.LocalCity();
	myCity.get(myFun);
})
   

